<template>
    <el-form :model="rowData">
    <el-form-item label="menuId" :label-width="formLabelWidth">
      <el-input v-model="rowData.menuId"></el-input>
    </el-form-item>
    <el-form-item label="name" :label-width="formLabelWidth">
      <el-input v-model="rowData.name"></el-input>
    </el-form-item>
    <el-form-item label="menuPanel" :label-width="formLabelWidth">
      <el-input v-model="rowData.menuPanel"></el-input>
    </el-form-item>
    <el-form-item label="orderNum" :label-width="formLabelWidth">
      <el-input v-model="rowData.orderNum"></el-input>
    </el-form-item>
    <el-form-item label="parentId" :label-width="formLabelWidth">
      <el-input v-model="rowData.parentId"></el-input>
    </el-form-item>
    <el-form-item label="perms" :label-width="formLabelWidth">
      <el-input v-model="rowData.perms"></el-input>
    </el-form-item>
    <el-form-item label="type" :label-width="formLabelWidth">
      <el-input v-model="rowData.type"></el-input>
    </el-form-item>
    <el-form-item label="url" :label-width="formLabelWidth">
      <el-input v-model="rowData.url"></el-input>
    </el-form-item>
    <el-form-item label="icon" :label-width="formLabelWidth">
      <el-input v-model="rowData.icon"></el-input>
    </el-form-item>
    <el-button @click="editCancel">取 消</el-button>
    <el-button type="primary" @click="editCommit">确 定</el-button>
  </el-form>
</template>

<script>
export default {
  name: "MenuListEdit",
  components: {},
  props: ["rowData"],
  data() {
    return {
      row: {},
      formLabelWidth: "120px",
    };
  },
  computed: {},
  watch: {},

  created() {
    console.log("rowData:");
    console.log(this.rowData);
  },
  mounted() {},
  methods: {
    editCancel() {
        this.$emit("editCancel")
    },
    editCommit() {
      console.log("editCommit:");
      console.log(this.rowData);
      this.$emit("editCommit")
      this.$http({
        url: "core/sys/menu/update",
        method: "post",
        data: this.rowData
       
      }).then((data) => {
        console.log("editCommit ok:");
        console.log(data.data);
        this.data = data.data;
        this.currentPage = data.data.page.currPage;
        this.pageSize = data.data.page.pageSize;
        this.totalCount = data.data.page.totalCount;
      });
    },
    dataChange() {
      console.log("datachange");
      this.$emit("MenuListEditChange", this.rowData);
    },
  },
};
</script>

<style scoped lang="less">
</style>
